cmake_minimum_required(VERSION 3.0)

## 可执行文件路径
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}")
set(CMAKE_FW_OUTPUT_DIRECTORY      "${CMAKE_BINARY_DIR}/out")
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/out/libs")
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/out/libs")

# 设置 C 编译器选项
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O0")
# 设置 C++ 编译器选项
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O0")

set(target "lzm_tcps")

project(${target})

# src
set(src
    tcps.c
)

# 添加可执行文件，并指定源文件
add_executable(${target} ${src})

# target_link_options(${target} PRIVATE -T ${CMAKE_CURRENT_SOURCE_DIR}/lzm_link.ld)
target_link_libraries(${target} PUBLIC pthread lzm_atomic)

add_subdirectory(lzm_atomic)
